From: Colin Walters Date: Tue, 25 Oct 2016 14:40:45 +0000 (-0400) Subject: tests: Skip libarchive/selinux tests if in container without SELinux X-Git-Tag: archive/raspbian/2022.1-3+rpi1~1^2~4^2~44^2~38 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=82a4f56593207b2f8a5e6620e64d9c3fa65fbfcf;p=ostree.git tests: Skip libarchive/selinux tests if in container without SELinux I'm doing builds and `make check` inside a Docker container, with selinux on as a build-time option, but no policy in the container. This currently aborts. Let's not do that. (This type of thing is why installed tests are a better model) Closes: #546 Approved by: jlebon --- diff --git a/tests/test-libarchive-import.c b/tests/test-libarchive-import.c index 3ef379e3..ad2e4c94 100644 --- a/tests/test-libarchive-import.c +++ b/tests/test-libarchive-import.c @@ -501,12 +501,10 @@ test_libarchive_selinux (gconstpointer data) { glnx_unref_object GFile *root = g_file_new_for_path ("/"); - /* creation should always succeed */ - sepol = ostree_sepolicy_new (root, NULL, &error); - g_assert (sepol != NULL); + sepol = ostree_sepolicy_new (root, NULL, NULL); } - if (ostree_sepolicy_get_name (sepol) == NULL) + if (sepol == NULL || ostree_sepolicy_get_name (sepol) == NULL) { g_test_skip ("SELinux disabled"); goto out;